import { Injectable } from '@angular/core';
import {MyHttpServiceImp} from "../../../utils/myhttp/MyHttpServiceImp"
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import { MyResponse } from "../../../utils/myhttp/MyResponse"
import { ArticleList } from './article-list.model';

@Injectable()
export class ArticleListService {

	constructor(private http: MyHttpServiceImp) { }

	getList(): Promise<MyResponse<ArticleList[]>> {
		return this.http.jsonpGet<ArticleList[]>('http://pv.sohu.com/cityjson').then(res => res as MyResponse<ArticleList[]>).catch( err=>Promise.reject(err));
	}
}